Skip to main content
This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal

HCL Notes/Domino 8.5 Forum (includes Notes Traveler)

HCL Notes/Domino 8.5 Forum (includes Notes Traveler)

Previous Next

It is as bad as you think...

"You can call agents on docs in 8.5.0 and 8.5.1, though this means you have to save the doc prior to processing. "

- True, this is possible. But my experience doing this shows it has a number of serious flaws:

1. One must save the document first. This is a whole can of worms, some my doing and some not.

a. In my instance I wind up committing data to the database that's invalid, because my validation logic is in LotusScript classes. Some of that logic could be put in JS, but some of it is impossible to put into JS without scrapping the entire system. So I commit invalid data and flag it as such in the Agent, because I have no choice.

b. It seems that saving the XPage document demands concurrencyMode=force if the LS Agent is going to attempt to actually commit data. Since I've never written an Agent (except LS to generate web pages) that does not commit data, this must be set or one gets save conflicts, even if the LS is coded save(true, true).

c. The above, (b), seems to cause a commit to fail if there aren't any changes to the document. Since LS has no way to know if anything has actually changed (no NotesDocument.isDirty, for instance), the normal way to do things is - when in doubt - save anyway. But if one does that from an XPage then

if(not doc.save(true, true)) then complain

will in fact complain, causing the code to fail. Every time. So I get to manually manage "dirtiness" to get code that's been working for years to keep working.

2. Once the Agent is done running, the SSJS on the XPage has no ready access to the results, as fields on currentDocument reflect the *old* values before the Agent ran. Deleting currentDocument has no effect. I surmise the XSP command processor keeps an in-memory copy during the Agent's execution, that it never bothers to refresh, which Is Not Good.

3. It seems having an Agent process code using LS2J when called from postSaveDocument on an XPage causes all manner of weirdness. The only way to fix this was to commit text describing the desired operation to a sessionScope variable, along with parameter data, then close the XPage and have the next page loaded check sessionScope, then process it using AJAX. LS2J is legacy code ... if legacy code is supported in an Agent from an XPage then this shouldn't be happening. Instead XPage + LS2J = nightmare.

4. The postSaveDocument event randomly fails to fire, so the XPages where a LS Agent actually can do something without freaking out, random doesn't do anything. To be more freakish, the querySaveDocument event does run, and even though that event does nothing what-so-ever but log that fact, pSD never goes off. i have never seen it function reliably over months, though it's possible once one stops rebuilding the application constantly it will in fact work reliably. But during development ... uh uh.

- Do not drink the legacy migration XPage Kool-Aid.


Feedback response number DGIE85SSLK created by ~Holly Zekhipisonnivu on 05/25/2010

XPages: why to use them? (~Alexis Minlute... 25.May.10)
. . Good summary... (~James Brewever... 25.May.10)
. . My comments (~Denise Xanaman... 25.May.10)
. . . . Thanks for the comments (~Alexis Minlute... 25.May.10)
. . It's not as bad as you think... (~Sanjay Quettum... 25.May.10)
. . . . It is as bad as you think... (~James Brewever... 25.May.10)
. . . . . . Trust me, no Kool-Aid here... (~Sanjay Quettum... 25.May.10)
. . . . . . . . Yet everyone seems to say it's 97% ... (~James Brewever... 25.May.10)
. . . . . . . . . . Just for others reading, not everyo... (~Elizabeth Minf... 26.May.10)
. . . . . . . . . . . . I agree completely! (~James Brewever... 26.May.10)
. . . . . . . . . . . . . . Heh... (~Sanjay Quettum... 26.May.10)
. . . . . . . . . . . . . . that is not what I said (~Elizabeth Minf... 26.May.10)
. . . . OK Thanks (~Alexis Minlute... 25.May.10)
. . My thoughts (~Maria Xanjumib... 25.May.10)
. . . . Thanks for your comments (~Alexis Minlute... 25.May.10)
. . . . . . use the MS OOXML SDK V2 for Excel 2... (~Elizabeth Minf... 26.May.10)
. . . . . . . . Is that Java based? (~Alexis Minlute... 26.May.10)
. . . . . . . . . . no Java yet (~Elizabeth Minf... 26.May.10)
. . . . . . . . . . . . I'm generating the XML (~Alexis Minlute... 27.May.10)
. . . . . . Some of my thoughts (~Elizabeth Dwoj... 25.May.10)
. . . . . . . . Good comments (~Alexis Minlute... 25.May.10)
. . . . . . Dojo Option for Charts (~Maria Xanjumib... 26.May.10)
. . . . . . . . Yes, I'm using them in my other rep... (~Alexis Minlute... 26.May.10)
. . One more positive comment (~Alexis Minlute... 26.May.10)
. . . . don't wait MS will develop a conver... (~Patti Desvelut... 31.Jan.11)




Printer-friendly

Search this forum

Member Tools


RSS Feeds

 RSS feedsRSS
All forum posts RSS
All main topics RSS